home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / ENET.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  3.8 KB  |  135 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ENET.p
  3.  
  4.      Contains:    Ethernet Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ENET;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __ENET__}
  30. {$SETC __ENET__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ENETIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __OSUTILS__}
  43. {$I OSUtils.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    Memory.p                                                    }
  47.  
  48. {$PUSH}
  49. {$ALIGN MAC68K}
  50. {$LibExport+}
  51.  
  52. CONST
  53.     ENetSetGeneral                = 253;                            {Set "general" mode}
  54.     ENetGetInfo                    = 252;                            {Get info}
  55.     ENetRdCancel                = 251;                            {Cancel read}
  56.     ENetRead                    = 250;                            {Read}
  57.     ENetWrite                    = 249;                            {Write}
  58.     ENetDetachPH                = 248;                            {Detach protocol handler}
  59.     ENetAttachPH                = 247;                            {Attach protocol handler}
  60.     ENetAddMulti                = 246;                            {Add a multicast address}
  61.     ENetDelMulti                = 245;                            {Delete a multicast address}
  62.     EAddrRType                    = 'eadr';
  63.  
  64.     
  65. TYPE
  66.     EParamBlkPtr = ^EParamBlock;
  67.  
  68.     {
  69.         ENETCompletionProcPtr uses register based parameters on the 68k and cannot
  70.         be written in or called from a high-level language without the help of
  71.         mixed mode or assembly glue.
  72.  
  73.         In:
  74.          => thePBPtr        A0.L
  75.     }
  76.     ENETCompletionProcPtr = Register68kProcPtr;  { register PROCEDURE ENETCompletion(thePBPtr: EParamBlkPtr); }
  77.     ENETCompletionUPP = UniversalProcPtr;
  78.  
  79.     EParamBlock = PACKED RECORD
  80.         qLink:                    ^QElem;                                    {General EParams}
  81.         qType:                    INTEGER;                                {queue type}
  82.         ioTrap:                    INTEGER;                                {routine trap}
  83.         ioCmdAddr:                Ptr;                                    {routine address}
  84.         ioCompletion:            ENETCompletionUPP;                        {completion routine}
  85.         ioResult:                OSErr;                                    {result code}
  86.         ioNamePtr:                StringPtr;                                {->filename}
  87.         ioVRefNum:                INTEGER;                                {volume reference or drive number}
  88.         ioRefNum:                INTEGER;                                {driver reference number}
  89.         csCode:                    INTEGER;                                {Call command code}
  90.         CASE INTEGER OF
  91.         0: (
  92.             eProtType:                    INTEGER;                            {Ethernet protocol type}
  93.             ePointer:                    Ptr;                                {No support for PowerPC code}
  94.             eBuffSize:                    INTEGER;                            {buffer size}
  95.             eDataSize:                    INTEGER;                            {number of bytes read}
  96.            );
  97.         1: (
  98.             eMultiAddr:                    PACKED ARRAY [0..5] OF Byte;        {Multicast Address}
  99.            );
  100.     END;
  101.  
  102. CONST
  103.     uppENETCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  104.  
  105. PROCEDURE CallENETCompletionProc(thePBPtr: EParamBlkPtr; userRoutine: ENETCompletionUPP);
  106.     {$IFC NOT GENERATINGCFM}
  107.     {To be implemented:  Glue to move parameters into registers.}
  108.     {$ENDC}
  109.  
  110. FUNCTION NewENETCompletionProc(userRoutine: ENETCompletionProcPtr): ENETCompletionUPP;
  111.     {$IFC NOT GENERATINGCFM }
  112.     INLINE $2E9F;
  113.     {$ENDC}
  114.  
  115. FUNCTION EWrite(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  116. FUNCTION EAttachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  117. FUNCTION EDetachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  118. FUNCTION ERead(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  119. FUNCTION ERdCancel(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  120. FUNCTION EGetInfo(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  121. FUNCTION ESetGeneral(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  122. FUNCTION EAddMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  123. FUNCTION EDelMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  124.  
  125. {$ALIGN RESET}
  126. {$POP}
  127.  
  128. {$SETC UsingIncludes := ENETIncludes}
  129.  
  130. {$ENDC} {__ENET__}
  131.  
  132. {$IFC NOT UsingIncludes}
  133.  END.
  134. {$ENDC}
  135.